<template>
    <div>
        <el-dialog title="查看详情" :visible.sync="dialogVisible" width="60%">
            <el-descriptions :column="2" border>
                <el-descriptions-item v-if="info.kind=='0'" label="姓名">{{ info.name }}</el-descriptions-item>
                <el-descriptions-item v-if="info.kind=='1'" label="机构名称">{{ info.name }}</el-descriptions-item>
                <el-descriptions-item label="联盟分类">{{ info.allianceType=='0'?'创新联合体':'产教联合体' }}</el-descriptions-item>
                <el-descriptions-item label="类型">{{ info.kind=='0'?'认证个人':'认证机构' }}</el-descriptions-item>
                <el-descriptions-item v-if="info.kind=='0'" label="身份证号">{{ info.identityId }}</el-descriptions-item>
                <el-descriptions-item v-if="info.kind=='0'" label="用户性别">{{ info.sex=='0'?'男':'女' }}</el-descriptions-item>
                <el-descriptions-item label="联系方式">{{ info.contactPerson }}</el-descriptions-item>
                <el-descriptions-item label="专业领域">{{ info.managerIntroduction }}</el-descriptions-item>
                
                <el-descriptions-item v-if="info.kind=='1'" label="统一社会信用代码">{{ info.tyshxydm }}</el-descriptions-item>
                <el-descriptions-item v-if="info.institutionType=='0'" label="机构类型">政府</el-descriptions-item>
                <el-descriptions-item v-if="info.institutionType=='1'" label="机构类型">企业</el-descriptions-item>
                <el-descriptions-item v-if="info.institutionType=='2'" label="机构类型">民非组织</el-descriptions-item>
                <el-descriptions-item v-if="info.institutionType=='3'" label="机构类型">教培组织</el-descriptions-item>
                <el-descriptions-item label="简介">{{ info.briefly }}</el-descriptions-item>
                <el-descriptions-item label="备注">{{ info.remark }}</el-descriptions-item>
                <el-descriptions-item v-if="info.status === '0'" label="审核状态">待审核</el-descriptions-item>
                <el-descriptions-item v-if="info.status === '1'" label="审核状态">审核通过</el-descriptions-item>
                <el-descriptions-item v-if="info.status === '2'" label="审核状态">审核驳回</el-descriptions-item>
                <el-descriptions-item label="审核人">{{ info.auditName }}</el-descriptions-item>
                <el-descriptions-item label="审核时间">{{ info.auditTime }}</el-descriptions-item>
                <el-descriptions-item label="审核意见">{{ info.opinion }}</el-descriptions-item>
            </el-descriptions>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script>
import { eduApplyDetail } from "@/request/api/education"
export default {
    data() {
        return {
            dialogVisible: false,
            innerVisible: false,
            info: {},
            form: {
                id: "", //
                supplierName: "", //供给方名称
                contractName: "",//合同名称
                contractUrl: "" //合同附件URL
            },
            formLabelWidth: '100px',
            fileUploadUrl: '/dev-api/file/upload/uploadNotQR',
            rules: {
                supplierName: [
                    { required: true, message: '请输入供给方名称', trigger: 'blur' },
                ],
                contractUrl: [
                    { required: true, message: '请上传合同附件', trigger: 'change' },
                ],
            },
            fileList: [],
            loading: false,
            userData: []
        }
    },
    methods: {
        open(info) {
            this.dialogVisible = true
            this.getDetail(info)
            this.form.id = info
        },
        // 查看详情
        getDetail(id) {
            eduApplyDetail(id).then(res => {
                console.log(res,'详情')
                if (res.data.code === 200) {
                    this.info = res.data.result
                }
            })
        },
        // 确认
        handleSure() {
            this.$refs.form.validate((valid) => {
                if (valid) {
                    this.loading = true
                    resourceContract(this.form).then((res) => {
                        this.loading = false
                        if (res.data.code === 200) {
                            this.$message({
                                message: res.data.message,
                                type: "success",
                            });
                            this.innerVisible = false
                            this.getDetail(this.form.id)
                        } else {
                            this.$message.error(res.data.message);
                        }
                    });
                }
            })
        },
        // 下载
        handleDown(url) {
            window.open(url)
        }
    }
}
</script>
<style lang="less" scoped>
/deep/.el-descriptions-item__label {
    width: 14%;
}

/deep/.el-descriptions-item__content {
    width: 31%;
}
</style>
<style lang="less">
.detailContent {

    // margin-top:20px;
    img {
        max-width: 100%;
        display: block;
    }
}

.tupian {
    margin-right: 10px;
}

.uploadBtn {
    margin: 12px 0 0;
}

.changeColor {
    color: #409eff;
    text-decoration: underline;
}
.contractName{
    margin-top:12px;
}
</style>

